package com.zz.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zz.entity.ReadRooms;
import com.zz.service.ReadRoomsService;

@Controller
@RequestMapping("/readrooms")
public class ReadRoomsController {
	@Autowired
	ReadRoomsService readService;
	
	/**
	 * 查询所有资源室
	 */
	@RequestMapping("getAll")
	@ResponseBody
	public Map<String, Object> getAll(){
		return readService.GetAll();
	}
	
	/**
	 * 添加和修改资源室
	 */
	@RequestMapping("saveAndFlush")
	@ResponseBody
	public Integer saveAndFlush(ReadRooms readrooms) {
		return readService.SaveAndFlushReadRooms(readrooms);
	}
	
	/**
	 * 删除资源室
	 */
	@RequestMapping("del")
	@ResponseBody 
	public Integer del(int id) {
		return readService.DelReadRooms(id);
	}
	
	
}
